<?php
include "counter2.php";

# To test for whether cookies are enabled
   setcookie("cookiesenabled", "true");

pagestart();
print "<html>\n";
pagehead(_("Log in"));
print "<body bgcolor=\"white\">";
pagetop(_("Log in"));
iamashowpage();
showmessage();
print "<form method=\"post\" action=\"/cgi-bin/runscript/login.cgi\">" .
"\n<table>" .
"\n<tr><td>" . _("Reg. number or email") . "<td><input name=\"user\">" .
"\n<tr><td>" . _("Password") . "<td><input type=\"password\" name=\"password\">" .
"\n<tr><td><td><input type=\"submit\" name=\"enter\" value=\"" . _("Enter") . "\">" .
"\n</table>";
print "<input type=\"hidden\" name=\"url\"";
$http_host = getenv("HTTP_HOST");
 if ($url != "") {
    echo "value=$url";
 } else if (preg_match("!^http://$http_host!", getenv("HTTP_REFERER"))) {
      echo "value=\"", getenv("HTTP_REFERER"), "\"";
 } else {
      echo "value=\"/person/\"";
}
print ">" .
"\n</form>";

print "\n<p>\n" .
_("The password (also called user key) is something like 12345-67890, and should have been in the message you got from the Linux Counter when you registered.") .
"\n</p>\n" .
"<strong>" . _("Note") . ":</strong> " . _("You must have <em>cookies</em> enabled in order to log in. An experimental workaround is in place to allow you to edit your home page without cookies - but this is not finished, and does not work for everything. Please report problems to") . emailCloaking("help@counter.li.org",0) .
"\n<hr>\n";

print "<p>\n" .
_("If you do not have your key, try to enter the E-mail address you used for registering below, and see if you get it E-mailed to you.") .
"\n</p>\n";

print "<form method=\"get\" action=\"/cgi-bin/runscript/emailquery.cgi\">" .
_("Email") . ": <input name=\"email\" size=\"30\" maxlength=\"160\">" .
"<br>" .
"<input TYPE=\"submit\" VALUE=\"" . _("Email me!") . "\"> <input TYPE=\"reset\" VALUE=\"" . _("Clear") . "\">" .
"\n</form>\n";
print _("If you do not have access to the email you registered any more, try the") . " <a href=\"$counter_site/lost-key.php\">" . _("Lost Key Request") . "</a> " . _("page.") .
"\n<p>\n" .
_("Someone should respond shortly.") .
"\n</p>";

pagebottom("yes");
print "</body>\n" .
"</html>";
?>
